<template>
  <div class="cockpit--tag" :style="{backgroundColor: textColor}">
    <slot></slot>
  </div>
</template>
<script>
export default {
  props: {
    color: {
      type: String,
      default: 'default'
    }
  },
  data() {
    return {
      defaultColor: {
        danger: '#AE351F',
        default: '#AD9672',
        warning: '#AD7321'
      },
      textColor: ''
    };
  },
  created() {
    const color = this.defaultColor[this.color];
    if (color) {
      this.textColor = color;
    } else {
      this.textColor = this.color;
    }
  }
};
</script>
<style lang="less" scoped>
.cockpit--tag {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  height: 21px;
  color: #fff;
  display: inline-block;
  border-radius: 20px;
  line-height: 0.9;
  margin: 0 4.5px;
  &:first-child {
    margin-left: 0;
  }
}
</style>
